package com.wty.learnsping.filter;

import javax.servlet.*;
import java.io.IOException;

//@WebFilter(filterName = "myFilter2",urlPatterns = "*.filter")
public class MyFilter2 implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("myFilter2 init");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("do myFilter2");
        filterChain.doFilter(servletRequest,servletResponse);
    }

    @Override
    public void destroy() {
        System.out.println("myFiletr2 destroy");
    }
}
